def count_paths(m, n):
    res = [[1] * n] * m
    for i in range(1, m):
        for j in range(1, n):
            res[i][j] = res[i - 1][j] + res[i][j - 1]
    return res[-1][-1]


result = count_paths(7, 3)
print(result)
